import Home from '@/views/home.vue'
import NotFound from '@/views/NotFound.vue'
import Login from '@/views/login.vue'
import NavBar from '@/component/navbar/index.vue'
import TabBar from '@/component/tabbar/index.vue'
const routes: Array<any> = [
    {
        path: '/home',
        components: {
            // 命名视图使用的配置，指明在对应名称的视图位置渲染指定组件
            default: Home,
            footer: TabBar,
        },
        meta: {
            // 元信息，可自定义与当前路由在开发阶段要用到的相关自定义数据
            title: '首页',
            icon: 'wap-home-o',
            inTabbar: true, // 表示当前路由是 tabbar 页面的路由
        },
    },
    {
        path: '/',
        components: {
            header: NavBar,
            default: Login,
        },
        meta: {
            title: '欢迎登录',
        },
    },
    {
        path: '/register',
        components: {
            header: NavBar,
            default: () => import('@/views/register.vue'),
        },
        meta: {
            title: '用户注册',
        },
    },
    {
        path: '/category',
        components: {
            header: NavBar,
            default: () => import('@/views/category.vue'),
            footer: TabBar,
        },
        meta: {
            title: '分类',
            icon: 'cluster-o',
            inTabbar: true,
        },
    },
    {
        path: '/cart',
        components: {
            header: NavBar,
            default: () => import('@/views/cart.vue'),
            footer: TabBar,
        },
        meta: {
            title: '购物车',
            icon: 'cart-o',
            inTabbar: true,
        },
    },
    {
        path: '/payOder',
        components: {
            header: NavBar,
            default: () => import('@/views/payOder.vue'),
        },
        meta: {
            title: '确认订单',
        },
    },
    {
        path: '/goPay',
        components: {
            header: NavBar,
            default: () => import('@/views/goPay.vue'),
        },
        meta: {
            title: '支付订单',
        },
    },
    {
        path: '/search',
        components: {
            header: NavBar,
            default: () => import('@/views/search.vue'),
        },
        meta: {
            title: '搜索',
        },
    },
    {
        path: '/detail',
        components: {
            header: NavBar,
            default: () => import('@/views/detail.vue'),
        },
        meta: {
            title: '商品详情',
        },
    },
    {
        path: '/onAdd',
        components: {
            header: NavBar,
            default: () => import('@/views/onAdd.vue'),
        },
        meta: {
            title: '添加收货地址',
        },
    },
    {
        path: '/mine',
        component: () => import('@/views/mine.vue'),
        components: {
            header: NavBar,
            default: () => import('@/views/mine.vue'),
            footer: TabBar,
        },
        meta: {
            title: '我的',
            icon: 'user-o',
            inTabbar: true,
        },
    },
    {
        path: '/myinfo',
        components: {
            header: NavBar,
            default: () => import('@/views/myinfo.vue'),
        },
        meta: {
            title: '个人资料',
        },
    },
    {
        path: '/oderlist',
        components: {
            header: NavBar,
            default: () => import('@/views/oderList.vue'),
        },
        meta: {
            title: '全部订单',
        },
    },

    {
        path: '/:pathMatch(.*)',
        component: NotFound,
    },
]
export default routes
